package com.orion.service.original;

import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.indices.CreateIndexResponse;
import co.elastic.clients.elasticsearch.indices.DeleteIndexResponse;
import co.elastic.clients.elasticsearch.indices.GetMappingResponse;
import com.orion.entity.*;

import java.io.IOException;

/**
 * @author Administrator
 * @date 2022/3/1
 */
public interface IEsService {

    <T> GetResponse<T> queryDocById(String idx, Long id,Class<T> clazz) throws IOException;

    DeleteIndexResponse deleteIndex(String idx) throws IOException;

    CreateIndexResponse createIndex(String idx, Integer numberOfShards, Integer numberOfReplicas) throws IOException;

    DeleteResponse deleteDoc(String idx, Long id) throws IOException;

    SearchResponse<Building> queryDeepPage(String idx, int pageSize, int from, Building building) throws IOException;

    SearchResponse<Building> queryComposite(String idx, Building building) throws IOException;

    SearchResponse<Car> aggs(String idx) throws IOException;

    UpdateResponse<Building> update(String idx, Building building) throws IOException;

    GetMappingResponse mapping(String idx) throws IOException;

    IndexResponse addDoc(String idx, Building building) throws IOException;

    SearchResponse<Car> aggsComposite(String idx) throws IOException;

    SearchResponse<Car> aggsMultiGroup(String idx) throws IOException;

    SearchResponse<Car> aggsBros(String idx) throws IOException;

    SearchResponse<Car> complexAggs(String idx) throws IOException;

    SearchResponse<Car> aggsFilterQuery(String idx,Car car) throws IOException;

    SearchResponse<Suggestion> suggest(String idx, String prefix) throws IOException;

    SearchResponse<NestObj> nested(String idx, Comment comment) throws IOException;
}
